<!doctype html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>山东省足球运动协会综合服务管理平台</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="./lib/layui/css/layui.css">
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <style>
        .container .logo a {
            width: 70%;
            font-size: 20px;
            font-weight: bold
        }
        .showDot{
            display: none;
        }
    </style>
    <!-- <link rel="stylesheet" href="./css/theme5.css"> -->

    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script>
        // 是否开启刷新记忆tab功能，刷新时是否重新选中第一个标签
        var is_remember = false;
    </script>
</head>

<body class="index">
    <!-- 顶部开始 -->
    <div class="container">
        <div class="logo">
            <a href="#"> <img src="./images/headicon.png" alt="" style="width: 50px;height:50px;line-height: 60px;">
                山东省足球运动协会综合服务管理平台</a>
        </div>
        <!-- <div class="left_open">
        <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
    </div> -->
        <ul class="layui-nav right" lay-filter="">
            <!--                <li class="layui-nav-item" style="margin-right: 100px;">-->
            <!--                    <a href="javascript:;" style="margin-right: 40px;">设置</a>-->
            <!--                    <dl class="layui-nav-child">-->
            <!--                        &lt;!&ndash; <dd>-->
            <!--                            <a onclick="xadmin.open('个人信息','http://www.baidu.com')">个人信息</a></dd>-->
            <!--                        <dd>-->
            <!--                            <a onclick="xadmin.open('切换帐号','http://www.baidu.com')">切换帐号</a></dd> &ndash;&gt;-->
            <!--                        <dd><a id="loginout" href="">退出</a></dd>-->
            <!--                    </dl>-->
            <!--                </li>-->
            <li class="layui-nav-item" lay-unselect>
                <!-- 消息中心 -->
                <a lay-href="#" lay-text="消息中心" onclick="xadmin.add_tab('角色管理','page/message.html'),true">
                    <i class="layui-icon layui-icon-notice"></i>  
                    
                    <!-- 如果有新消息，则显示小圆点 -->
                    <span class="layui-badge-dot showDot"></span>
                </a>
            </li>
            <li class="layui-nav-item to-index">
                <a><span id="name"></span><span style="margin-left: 40px;"></span></a>
                <dl class="layui-nav-child">
                    <dd><a id="loginout" href="">退出</a></dd>
                    <dd><a id="changephone" href="javascript:void(0)">修改手机号</a></dd>
                    <dd><a id="changepassword" href="javascript:void(0)">修改密码</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
    <!-- 左侧菜单开始 -->
    <!-- onclick="xadmin.open('编辑','admin-edit.html')" 打开遮罩层-->
    <div class="left-nav" style="overflow-y: scroll">
        <div id="side-nav">
            <ul id="nav">
            </ul>
        </div>
    </div>
    <!-- <div class="x-slide_left"></div> -->
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
            <!-- lay-allowclose是否显示关闭按钮 -->
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <iframe src='page/personal.html' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
                </div>
            </div>
            <div id="tab_show"></div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script src="./js/jquery.min.js"></script>
    <script src="./js/base.js"></script>
    <style id="theme_style"></style>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <script>
        var telnum
        $.ajax({
            url: findUserById,
            type: 'post',

            success: function (data) {
                if (data.user.name == "超级管理员") {
                    $("#changephone").css("display", "none")
                }
                telnum = data.user.tel
            },
            error: function (data) {

            }
        });
        // 获取是否有未读消息
        $.ajax({
            url:getIsNotReadMessage,
            type:'post',
            success:function(res){
                console.log(res,'输出res11111111111')
                if(res.msg == 0){
                    if(res.data.list.length !== 0){
                        $('.showDot').css('display','inline-block')
                    } else {
                        $('.showDot').css('display','none')
                    }
                }
            },
            error:function(data){

            }
        })

       
        if(localStorage.getItem('isTost') == 1){ //已经改了
            // console.log('已经改了')
        }else{ //请求接口
            $.ajax({
                url: LL_upPwdTost,
                dataType: 'json',
                type: 'get',
                success: function (res) {
                    //seccess？href跳转：alert(msg)\
                    console.log(res,'是否修改密码')
                    // if(res.msg == 0){
                        if(res.state == 1){
                            layer.confirm("前往修改初始密码",{
                                btn: ['确定', '取消']
                            }, function (index) {
                                layer.close(index);
                                layer.open({
                                    type: 2,
                                    content: './page/changePassWord.html',
                                    area: ["500px", "450px"],
                                    title: "修改密码",
                                    // btn: ['确认', '取消'],//开启显示按钮功能
                                    // btnAlign: 'c',//居中显示按钮
                                    // shade:true,
                                    shadeClose: true, //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                                });
                                localStorage.setItem('isTost',1)
                            }, function(index){
                                localStorage.setItem('isTost',1)
                            });
                        }else{
                            localStorage.setItem('isTost',1)
                        }
                    // }else{
                    //     layer.alert(res.msg, {
                    //         title: '提示'
                    //     })
                    // }
                },
                error: function (error) {
                    console.log(error)
                }
            })
        }
        $(function () {
            $("#changepassword").on("click", function () {
                layer.open({
                    type: 2,
                    content: './page/changePassWord.html',
                    area: ["500px", "450px"],
                    title: "修改密码",
                    // btn: ['确认', '取消'],//开启显示按钮功能
                    // btnAlign: 'c',//居中显示按钮
                    // shade:true,
                    shadeClose: true, //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                });
            })
            $("#changephone").on("click", function () {
                layer.open({
                    type: 2,
                    content: './page/changePhoneNum.html',
                    area: ["500px", "400px"],
                    title: "解绑手机号",
                    shadeClose: true, //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                    success: function (layero, index) {
                        var body = layer.getChildFrame('body', index);
                        var iframeWin = window[layero.find('iframe')[0]['name']];
                        body.find(".phone1").val(telnum);
                    }
                });
            })
            $("#loginout").on("click", function () {
                console.log(1)
                $.ajax({
                    type: "get",
                    url: LOGINOUT,
                    success: function (res) {
                        if (res.msg == 0) {
                            console.log(res)
                            location.href = "login.html"
                            // } else {
                            //     console.log(error)
                        }
                    },
                    error: function (error) {
                        console.log(error)
                        alert(JSON.stringify(error))
                    }
                })
                return false
            })
            // 获取登陆者信息
            $.ajax({
                type: "get",
                url: findUserById,
                success: function (res) {
                    if (res.msg == 0) {
                        console.log(res)
                        $("#name").html(res.user.name);
                    }
                },
                error: function (error) {
                    console.log(error)
                    alert(JSON.stringify(error))
                }
            })

            $.ajax({
                type: "get",
                url: findMeau,
                success: function (res) {
                    console.log(res, "菜单")
                    if (res.msg == '0') {
                        for (var i = 0; i < res.parentList.length; i++) {
                            var parentStr = "";
                            parentStr += '<li>' +
                                '<a class="" href="javascript:;">' +
                                '<i class="iconfont left-nav-li" lay-tips="' + res.parentList[i]
                                .funName + '">&#xe723;</i>' +
                                '<cite>' + res.parentList[i].funName + '</cite>' +
                                '</a>'
                            var childStr = "";
                            if (res.parentList[i].childList) {
                                for (var j = 0; j < res.parentList[i].childList.length; j++) {
                                    childStr += '<ul class="sub-menu">' +
                                        '<li>' +
                                        '<a class="" href="javascript:;" onclick="xadmin.add_tab(\'' +
                                        res.parentList[i].childList[j].funName + '\',\'' + res
                                        .parentList[i].childList[j].href + '\'),true">' +
                                        '<i class="iconfont left-nav-li" lay-tips="' + res
                                        .parentList[i].childList[j].funName + '">&#xe723;</i>' +
                                        '<cite>' + res.parentList[i].childList[j].funName +
                                        '</cite>' +
                                        '</a>' +
                                        '</li>' +
                                        '</ul>';
                                }
                                parentStr += childStr + "</li>";
                                $("#nav").append(parentStr);
                            } else {
                                $("#nav").append('<li>' +
                                    '<a class="" href="javascript:;" onclick="xadmin.add_tab(\'' +
                                    res.parentList[i].funName + '\',\'' + res.parentList[i]
                                    .href + '\'),true">' +
                                    '<i class="iconfont left-nav-li" lay-tips="' + res
                                    .parentList[i].funName + '">&#xe723;</i>' +
                                    '<cite>' + res.parentList[i].funName + '</cite>' +
                                    '</a>' +
                                    '</li>'
                                );
                            }
                        }
                    } else {
                        parent.window.location.href = getRequestPrefix() +
                            "/footBallAdmin/login.html"
                    }
                },
                error: function (error) {
                    console.log(error)
                    alert(JSON.stringify(error))
                }
            })
        })
    </script>
</body>

</html>